<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:x="http://www.xseam.org"
    template="/WEB-INF/layout/bootstrap.xhtml">

<ui:define name="container">

    <div class="page-header">
	  <h3>Estudante Search</h3>

      <h:form id="setorSearch" styleClass="form-horizontal">
		  
		  <x:inputText id="nome" label="Nome" value="#{setorList.setor.nome}" />
          
          <div class="control-group">
            <h:outputLabel value="Match" for="logic" styleClass="control-label" />
            <div class="controls">
              <h:selectOneRadio id="logic" value="#{setorList.restrictionLogicOperator}" layout="pageDirection" styleClass="label-inline">
                <f:selectItem itemLabel="All" itemValue="and"/>
                <f:selectItem itemLabel="Any" itemValue="or"/>
              </h:selectOneRadio>
            </div>
          </div>
		  
	      <div class="form-actions">
	        <a href="#{x:contextPath()}/SetorList.jsf" class="btn btn-primary">
	          <i class="icon-search icon-white"></i>
	          Pesquisar
	        </a>
	      </div>
      </h:form>
      
	</div>
	
	<div class="page-header">
	  <h:form id="estudante-datatable">
	  <h:dataTable id="estudanteList" var="estudante" value="#{estudanteAction.resultList}" styleClass="table table-striped" rendered="#{not empty estudanteAction.resultList}">
	    <h:column>
            <f:facet name="header">#</f:facet>
            <h:outputText value="#{estudante.id}" />
        </h:column>
        <h:column>
            <f:facet name="header">CPF</f:facet>
            <h:outputText value="#{estudante.cpf}" />
        </h:column>  
        <h:column>
            <f:facet name="header">Nome</f:facet>
            <h:outputText value="#{estudante.nome}" />
        </h:column>
        <h:column>
            <f:facet name="header">Nome da Mãe</f:facet>
            <h:outputText value="#{estudante.mae}" />
        </h:column>
        <h:column>
            <f:facet name="header">Criado em</f:facet>
            <h:outputText value="#{estudante.createdOn}">
              <f:convertDateTime pattern="dd/MM/yyyy"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header">Última atualização</f:facet>
            <h:outputText value="#{estudante.lastUpdate}">
              <f:convertDateTime pattern="dd/MM/yyyy"/>
            </h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header"></f:facet>
            <div class="row-fluid">
               <a href="#{x:contextPath()}/EstudanteEdit.jsf" class="btn btn-small btn-info">
                <f:param name="cpf" value="#{estudante.cpf}"/>
                <i class="icon-edit"></i>
              </a>
              <span style="margin-right: 3px;"></span>
               <a href="#{x:contextPath()}/EstudanteList.jsf" class="btn btn-small btn-danger">
                <f:param name="cpf" value="#{estudante.cpf}"/>
                <i class="icon-trash icon-white"></i>
                Excluir
              </a>
            </div>
        </h:column>
	  </h:dataTable>
	  </h:form>
	  
	  <x:div id="form-actions" styleClass="form-actions" rendered="#{empty from}">
        <a href="#{x:contextPath()}/EstudanteEdit.jsf" class="btn btn-large btn-primary">
          <i class="icon-plus icon-white"></i>
          Novo
        </a>
      </x:div>
	</div>

</ui:define>

</ui:composition>
